/*
*classroom.js 考场信息
*/

$(document).ready(function () {
	$.ajax({
		url: '../classroomAll.action',
		type: 'post',    
		cache: false,    
		dataType: 'json',   
		data: {}, 
		success: function (resp) {
			var result = eval("("+resp+")");
			//alert(result);
			var array1 = eval("("+result.data+")");
			var html = "";
    		if( result.flag == "true" ){  
    			//alert("加载成功");
    			var status = "";
    			$.each(array1, function(i, value) {
        			switch(value.status){
        			case 0:
        				 status = "空闲";
        				 break;
        			case 1:
        				 status = "未满";
        				 break;
        			case 2:
        				 status = "满员";
        				 break;
        		    default:
        				status = "获取失败";
        			}
    				html += "<tr><td>"+value.epclassId+"</td><td>"+value.limitNo+"</td><td>"+value.nowNo+"</td><td>"+status+"</td></tr>";
    			});
    			//alert(html);
    			$("#data").html(html);
            }else{  
             	alert(result.reason);    
            }    
		  },    
		error : function () {   
     	 	alert("通信失败");    
		}    
	});
})